package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 商品实体类
 */
@Data
@TableName("product")
public class Product {
    @TableId(type = IdType.AUTO)
    @TableField("product_id")
    private Integer id;
    @TableField("product_name")
    private String name;
    //已销售数量
    @TableField("sold_num")
    private Integer soldNum;
    @TableField("product_status")
    private Integer status;
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("create_time")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("update_time")
    private Date updateTime;

    //商品图片
    @TableField(exist = false)
    private List<ProductImg> productImgs;

    @TableField(exist = false)
    private Long TotalSales;
}

//@Data
//@TableName("product")
//public class Product {
//
//    private String id;//商品的id
//    private String name;//商品的名字
////    @TableField(exist = false)
//    private Long TotalSales;//该商品所有类型售卖的总价
//
//    //已销售数量
//    @TableField("sold_num")
//    private Integer soldNum;
//    @TableField("product_status")
//    private Integer status;
//    private String content;
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @TableField("create_time")
//    private Date createTime;
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @TableField("update_time")
//    private Date updateTime;
//
//    //商品图片
//    @TableField(exist = false)
//    private List<ProductImg> productImgs;
//}


